package com.hj.student;

import java.util.ArrayList;
import java.util.Scanner;

public class StudentIndex {
    public static void main(String[] args) {
        ArrayList<Student> list = new ArrayList<>();
        outer:
        while (true) {
            System.out.println("----------欢迎来到学生管理系统----------");
            System.out.println("1.添加学生");
            System.out.println("2.删除学生");
            System.out.println("3.修改学生");
            System.out.println("4.查询所有学生");
            System.out.println("5.退出");
            System.out.println("--------------------------------------");
            System.out.println("请输入你的选择：");
            int choice = new Scanner(System.in).nextInt();
            switch (choice) {
                case 1:
                    Function.add(list);
                    break;
                case 2:
                    Function.delete(list);
                    break;
                case 3:
                    Function.change(list);
                    break;
                case 4:
                    Function.finAll(list);
                    break;
                case 5:
                    System.out.println("谢谢使用");
                    break outer;
                default:
                    System.err.println("输入有误");
                    break;
            }
        }
    }
}
